<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Carbon\Carbon;

class CmSubjectSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $subjects = [
            ['subject_name' => '数学', 'sort' => 1],
            ['subject_name' => '语文', 'sort' => 2],
            ['subject_name' => '英语', 'sort' => 3],
            ['subject_name' => '物理', 'sort' => 4],
            ['subject_name' => '化学', 'sort' => 5],
            ['subject_name' => '生物', 'sort' => 6],
            ['subject_name' => '历史', 'sort' => 7],
            ['subject_name' => '地理', 'sort' => 8],
            ['subject_name' => '政治', 'sort' => 9],
            ['subject_name' => '计算机科学', 'sort' => 10],
        ];

        foreach ($subjects as $subject) {
            DB::table('cm_subject')->insert([
                'subject_name' => $subject['subject_name'],
                'sort' => $subject['sort'],
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ]);
        }
    }
}